/**
 * 日志等级
 */
export enum LOG_LEVEL {
  EVERYTHING = 0, LOG = 1, WARN = 2, ERROR = 3, NOTHING = 99
}

/**
 * Console 对象工具类
 */
export class XConsole {


  constructor(private _level: LOG_LEVEL = LOG_LEVEL.EVERYTHING) {
  }

  log(...params) {
    if (this._level <= LOG_LEVEL.LOG) {
      console.log(...params);
    }
  }

  warn(...params) {
    if (this._level <= LOG_LEVEL.WARN) {
      console.warn(...params);
    }
  }

  error(...params) {
    if (this._level <= LOG_LEVEL.ERROR) {
      console.error(...params);
    }
  }
}
